Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid implicit injection _fastbootInfo deprecation #841

Merged

Conversation

snewcomer
Copy link
Contributor

As noted in reference PR, the deprecation is issued when the FastBoot service is created. However, if we also register a property with the same name as the implicit injection (app.inject('service:foo', 'store', 'some:object')), the deprecation goes away.

close #819
ref https://github.com/ember-fastboot/ember-cli-fastboot/pull/823/files
rfc emberjs/rfcs#680

@snewcomer snewcomer self-assigned this Aug 2, 2021
@snewcomer snewcomer changed the title Avoid implicit injection deprecation Avoid implicit injection _fastbootInfo deprecation Aug 2, 2021
@@ -88,6 +89,11 @@ const FastBootService = Service.extend({
return RequestObject.create({ request: get(this, '_fastbootInfo.request') });
}),

_fastbootInfo: computed(function() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the test changes in https://github.com/ember-fastboot/ember-cli-fastboot/pull/823/files? Specifically registering info:-fastboot in the container for later lookup.

Copy link
Contributor Author

@snewcomer snewcomer Aug 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like it based on the tests passing! Do you see other value here?

@snewcomer snewcomer force-pushed the sn/no-deprecation-implicit branch from f89c712 to 2d89348 Compare August 8, 2021 17:18
@xg-wang xg-wang merged commit 0ef9404 into ember-fastboot:master Aug 8, 2021
@snewcomer snewcomer deleted the sn/no-deprecation-implicit branch August 8, 2021 18:10
@ef4
Copy link
Contributor

ef4 commented Sep 10, 2021

This is not really fixed. Adding ember-cli-fastboot 3.2.0-beta.3 to a new ember 3.27 app still results in the implicit injection deprecation message the first time you render in fastboot.

I think code like this needs to go away:

instance.inject('service:fastboot', '_fastbootInfo', 'info:-fastboot');

ef4 added a commit that referenced this pull request Sep 10, 2021
This is required to clear the implicit-injection deprecation on Ember 3.27.

This may need to be released as a semver major because this version of `fastboot` will only work with versions of `ember-cli-fastboot` after #841
@xg-wang
Copy link
Member

xg-wang commented Sep 10, 2021

@ef4 would a new schema version avoid breaking change? Essentially the attempt at https://github.com/ember-fastboot/ember-cli-fastboot/pull/823/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DEPRECATION: A value was injected implicitly on the '_fastbootInfo' property
3 participants